package foot.modele;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class Tour {
	private int numeroTour;
	private Collection<Match> matchsDuTour;
	
	@Id
	public int getNumeroTour() {
		return numeroTour;
	}
	public void setNumeroTour(int numeroTour) {
		this.numeroTour = numeroTour;
	}
	@OneToMany
	public Collection<Match> getMatchsDuTour() {
		return matchsDuTour;
	}
	public void setMatchsDuTour(Collection<Match> matchsDuTour) {
		this.matchsDuTour = matchsDuTour;
	}
	@Override
	public int hashCode() {
		return numeroTour;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Tour other = (Tour) obj;
		if (matchsDuTour == null) {
			if (other.matchsDuTour != null)
				return false;
		} else if (!matchsDuTour.equals(other.matchsDuTour))
			return false;
		if (numeroTour != other.numeroTour)
			return false;
		return true;
	}
	
	

}
